package com.web.music.interfaces;

import java.io.File;
import java.io.InputStream;
import java.util.Map;

import com.web.music.model.*;

/**
 * Interface for XML parsing operations.
 * Helps to extract information from XML files of certain structure.  
 * 
 * TODO [done] 
 * Your task is to extend XmlParser to extract data from catalog.xml as well.
 */
public interface XmlParser 
{
	/**
	 * Extracts information about people from XML file at specified location.
	 * 
	 * @param file - XML file containing people data
	 * @return a map <person id, person object>
	 */
	public Map<String,Person> extractPeopleInfo(File xmlFile);
	
	/**
	 * Extracts information about people from XML file represented as InputStream.
	 * 
	 * @param input - XML file as InputStream
	 * @return a map <person id, person object>
	 */
	public Map<String,Person> extractPeopleInfo(InputStream input);	
	
	public Map<String,Genre> extractGenreInfo(File xmlFile);
	public Map<String,Genre>  extractGenreInfo(InputStream input);

	public Map<String,Artist> extractArtistInfo(File xmlFile, Map<String,Genre> genres, Map<String,Person> people );
	public Map<String,Artist>  extractArtistInfo(InputStream input, Map<String,Genre> genres, Map<String,Person> people);
	
	public Map<String, Album> extractAlbumInfo(File xmlFile, Map<String, Artist> artists, Map<String,Genre> genres);
	public Map<String, Album> extractAlbumInfo(InputStream input, Map<String, Artist> artists, Map<String,Genre> genres);	

}
